package org.example.util;

import org.example.csv.CSVData;
import org.junit.Ignore;
import org.junit.Test;

import java.nio.file.Path;
import java.nio.file.Paths;

@Ignore
public class ReadFaster {

    public static void main(String[] args) {
        ReadFaster readFaster = new ReadFaster();
        readFaster.testNormalRead();
        readFaster.test1();
        readFaster.test2();
    }

    String filePath = "/home/root1/sunhb/selflearn/tugraphCompetition/tugraphTest2/src/main/resources/data/verified_result1.csv";

    @Test
    public void testNormalRead() {
        Path path = Paths.get(filePath);
        long st = System.currentTimeMillis();
        CSVData csvData = CSVUtils.read(path);
        long ed = System.currentTimeMillis();
        System.out.println((ed - st) + " ms");
    }

    @Test
    public void test1() {
        Path path = Paths.get(filePath);
        long st = System.currentTimeMillis();
        CSVData csvData = CSVFaster.read(path);
        long ed = System.currentTimeMillis();
        System.out.println((ed - st) + " ms");
        // for (int i = 0; i < list.size(); i++) {
        //     System.out.println(Arrays.asList(list.get(i)));
        // }
    }

    @Test
    public void test2() {
        Path path = Paths.get(filePath);
        long st = System.currentTimeMillis();
        CSVData csvData = CSVFaster2.read(path);
        long ed = System.currentTimeMillis();
        System.out.println((ed - st) + " ms");
        // for (int i = 0; i < list.size(); i++) {
        //     System.out.println(Arrays.asList(list.get(i)));
        // }
    }
}
